﻿@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>


<div id="console-log">
    
</div>
@Html.TextBox("console", string.Empty, new { id="console-line" }) 
<a href="javascript:void(0);" id="terminal-submit">></a>

<script type="text/javascript">
    $('#console-line').keyup(function(event){
        if (event.keyCode == 13) {
            var commandValue = $(this).val();
            var lastChild = $("#console-log:last-child");
            $('<p>' + commandValue + '</p>').appendTo($("#console-log"));
            $.get('/base/terminal/execute', { command: commandValue }, function (result) {
                console.log(result);
            });                
        }
    });

    var canvas = document.getElementById("canvas");
    var context = canvas.getContext("2d");

    context.clearRect(0, 0, 500, 170);
    context.fillStyle = "#ff00ff";
    context.fillRect(x, y, 25, 25);
</script>
